package sistemioperativi.matrice.es3;

public class Launcher {

	
	public static void main(String[] args) {
	
		int[][] matrix = new int [3][4];
		int x = 3;
		int y = 2;
		
		matrix[0][0] = 3;
		matrix[0][1] = 5;
		matrix[0][2] = 3;
		matrix[0][3] = 2;
		matrix[1][0] = 2;
		matrix[1][1] = 2;
		matrix[1][2] = 1;
		matrix[1][3] = 2;
		matrix[2][0] = 4;
		matrix[2][1] = 3;
		matrix[2][2] = 3;
		matrix[2][3] = 1;
		
	
	ControlloRiga[] righe = new ControlloRiga[matrix.length];	
	
	for(int i = 0; i<matrix.length; i++){
	righe[i] = new ControlloRiga(matrix,x,y,i);	
	righe[i].start();
	}
	
	//readyUp righe
	
	for(int i = 0; i<righe.length; i++){
		if(righe[i].ready() == false)
			if( i != 0 )
				i = i-1;
			else
				i = 0;
	}
	
	int tempX = 0;
	int tempY = 0;
	
	for(int i = 0; i<righe.length; i++){
	
		tempX += righe[i].contX();
		tempY += righe[i].contY();
	
	}
	
	if(tempX > tempY)
		System.out.println(true);
	if(tempX < tempY)
		System.out.println(false);
	
	}//main

}//class
